package legway.tests;

import legway.datalogger.*;
import lejos.nxt.Motor;
import lejos.nxt.SensorPort;

public class GyroAngSpeedTest {

	public static void main(String[] args) {
		GyroSensor gyro = new GyroSensor(SensorPort.S1);
		CustomDataLogger datalogger = new CustomDataLogger("angSpeedTest.log", CustomDataLogger.NEWINCREMENTED, true, "Angular speed	Actual speed");
		
		Motor.A.smoothAcceleration(false);
		Motor.A.setSpeed(400);
		Motor.A.rotate(360, true);
		
		double value;
		int actual;
		while(Motor.A.isMoving()) {
			value = gyro.getAngularSpeed();
			actual = Motor.A.getRotationSpeed();
			datalogger.writeString("" + (int)value + "	" + actual);
			try {
				Thread.sleep(4);
			} catch (InterruptedException e) {
			}
		}
		datalogger.close();
	}
}
